"""
@author: Sergiy Tsymbalyuk
"""

import logging

from pylons.i18n import lazy_ugettext as _

from repoze.what.plugins.pylonshq import ControllerProtector
from repoze.what.predicates import has_permission

from chowa.lib.site.crud import FlatCrudController
from chowa.model import Menu

log = logging.getLogger(__name__)

@ControllerProtector(has_permission('site.administer.navigation'))
class MenusController(FlatCrudController):
    __model__ = Menu
    __references__ = {'items': 'admin/navigation/menuitems'}
    __main_heading__ = _('Site building')